﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Data;
using OgilvyOne.DALFactory;
using OgilvyOne.BLL;
using OgilvyOne.Model;
using OgilvyOne.Utility;

namespace OgilvyOne.BLL
{
    /// <summary>
    /// HTML 拼接类
    /// </summary>
    public class ContentHtmlPage
    {
        MenuModel menupage;
        public ContentHtmlPage(MenuModel menupage)
        {
            this.menupage = menupage;
        }

        /// <summary>
        /// 截取字符串长度
        /// </summary>
        /// <param name="str"></param>
        /// <param name="length"></param>
        /// <returns></returns>
        public static string GetSubString(string str, int length)
        {
            if (str == null) return "";
            length = length * 2;
            str = FilterHtml(str);
            string temp = str;
            int j = 0;
            int k = 0;
            for (int i = 0; i < temp.Length; i++)
            {
                try
                {
                    if (Regex.IsMatch(temp.Substring(i, 1), @"[\u4e00-\u9fa5]+"))
                    {//是否中文
                        j += 2;
                    }
                    else
                    {
                        j += 1;
                    }
                    if (j <= length)
                    {
                        k += 1;
                    }
                    if (j >= length)
                    {//终止循环
                        return temp.Substring(0, k) + "...";
                    }
                }
                catch (Exception e)
                {
                    Console.Write(e.Message);
                }
            }
            return temp;
        }
        static Regex regex = new Regex("<[^<^>]+>");
        static Regex regexHand = new Regex("&\\w+;");
        public static string FilterHtml(string html)
        {
            return regexHand.Replace(regex.Replace(html, ""), "").Replace("\n", "").Replace("\t", "");
        }

        /// <summary>
        /// 头部导航
        /// </summary>
        /// <returns></returns>
        public static string GetHeader()
        {
            return ((TemplateLabelModel)new TemplateLabelBll().GetLabelMap()["header"]).Value;
        }
        /// <summary>
        /// 公共css/js
        /// </summary>
        /// <returns></returns>
        public static string GetCssjs()
        {
            return ((TemplateLabelModel)new TemplateLabelBll().GetLabelMap()["cssjs"]).Value;
        }
        /// <summary>
        /// 底部导航
        /// </summary>
        /// <returns></returns>
        public static string GetFooter()
        {
            return ((TemplateLabelModel)new TemplateLabelBll().GetLabelMap()["footer"]).Value;
        }
        /// <summary>
        /// 栏目内容年月查询
        /// </summary>
        /// <param name="cid"></param>
        /// <param name="year"></param>
        /// <param name="month"></param>
        /// <returns></returns>
        public string GetNewsYearMonth(int cid, int year, int month)
        {

            Hashtable yearmap = CmsArticleFrontFactory.create().GetArticleGroupYear(cid);
            return GetYearMonthSearch(yearmap, cid, year, month);

        }
        /// <summary>
        /// 栏目年月查询
        /// </summary>
        /// <param name="cid"></param>
        /// <param name="year"></param>
        /// <param name="month"></param>
        /// <returns></returns>
        public string GetColumnYearMonth(int cid, int year, int month)
        {
            Hashtable yearmap = CmsArticleFrontFactory.create().GetColumnGroupYear(cid);
            return GetYearMonthSearch(yearmap, cid, year, month);
        }

        public string GetColumnYear(int cid, int year)
        {
            Hashtable yearmap = CmsArticleFrontFactory.create().GetColumnGroupYear(cid);
            StringBuilder sb = new StringBuilder();
            sb.Append("<select name=\"year\" id=\"year\" onchange='query();'>\n");
            foreach (object obj in yearmap.Keys)
            {
                string key = obj.ToString();
                sb.Append("<option value=\"" + key + "\" " + (key == year.ToString() ? "selected='selected'" : "") + ">" + key + "</option>\n");
            }
            sb.Append("</select>\n");
            sb.Append("<script type=\"text/javascript\">\n");
            sb.Append("function query(){\n");
            sb.Append(" location.href = '" + menupage.GetUrl(cid) + "&year='+jQuery('#year').val();\n");
            sb.Append("}\n");

            sb.Append("</script>\n");
            return sb.ToString();
        }



        private string GetYearMonthSearch(Hashtable yearmap, int cid, int year, int month)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("<select name=\"year\" id=\"year\" onchange='month(this.value)'>\n");
            foreach (object obj in yearmap.Keys)
            {
                string key = obj.ToString();
                sb.Append("<option value=\"" + key + "\" " + (key == year.ToString() ? "selected='selected'" : "") + ">" + key + "</option>\n");
            }
            sb.Append("</select>\n");
            IList ms = (IList)yearmap[year];
            sb.Append("<select name=\"month\" id=\"month\" onchange='query();'>\n");
            if (ms != null)
            {
                foreach (object obj in ms)
                {
                    string key = obj.ToString();
                    sb.Append("<option value=\"" + key + "\" " + (key == month.ToString() ? "selected='selected'" : "") + ">" + key + "</option>\n");
                }
            }
            sb.Append("</select>\n");
            sb.Append("<script type=\"text/javascript\">\n");
            sb.Append("var years = [];\n");
            foreach (object obj in yearmap.Keys)
            {
                sb.Append("years[" + obj.ToString() + "]=[");
                IList mlist = (IList)yearmap[obj];
                for (int i = 0; i < mlist.Count; i++)
                {
                    sb.Append(mlist[i]);
                    if (i < mlist.Count - 1)
                    {
                        sb.Append(",");
                    }
                }
                sb.Append("];\n");
            }
            sb.Append("function query(){\n");
            sb.Append(" location.href = '" + menupage.GetUrl(cid) + "&year='+jQuery('#year').val()+'&month='+jQuery('#month').val();\n");
            sb.Append("}\n");
            sb.Append("function month(year){\n");
            sb.Append(" var monthopts = document.getElementById('month').options;\n");
            sb.Append(" var ms = years[year];\n");
            sb.Append(" monthopts.length=0;\n");
            sb.Append(" for(var i=0;i<ms.length;i++){\n");
            sb.Append(" var opt = new Option(ms[i],ms[i]);\n");
            sb.Append(" monthopts.add(opt);\n");
            sb.Append("}\n");
            sb.Append("query();\n");
            sb.Append("}\n");
            sb.Append("</script>\n");
            return sb.ToString();

        }
        /// <summary>
        /// 新闻列表
        /// </summary>
        /// <param name="cid"></param>
        /// <param name="year"></param>
        /// <param name="month"></param>
        /// <returns></returns>
        public string GetNewsYearMonthList(int cid, int year, int month)
        {
            StringBuilder sb = new StringBuilder();
            IList datalist = CmsArticleFrontFactory.create().GetNewsList(cid, year, month);
            for (int i = 0; i < datalist.Count; i++)
            {
                CmsArticleModel cm = (CmsArticleModel)datalist[i];
                sb.Append("<li><span class=\"time\">" + GetArticlePubDate(cm) + "</span> <a href=\"" + menupage.GetArticleUrl(cm) + "\" target=\"" + ConConstants.CONTENT_TARGET + "\">" + cm.Title + "</a></li>");
            }
            return sb.ToString();
        }

        /// <summary>
        /// 文章发布日期
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static string GetArticlePubDate(CmsArticleModel model)
        {
            return model.Starttime.Year > 1900 ? model.Starttime.ToString(ConConstants.DATE_FORMAT_STR) : (model.Modifytime.Year > 1900 ? model.Modifytime.ToString(ConConstants.DATE_FORMAT_STR) : model.Addtime.ToString(ConConstants.DATE_FORMAT_STR));
        }
        /// <summary>
        /// 新闻左多图
        /// </summary>
        /// <param name="aid"></param>
        /// <returns></returns>
        public string GetArticleImgs(int aid)
        {
            StringBuilder bigsb = new StringBuilder();
            StringBuilder smallsb = new StringBuilder();
            IList imgs = CmsArticleFrontFactory.create().GetImgs(aid, CmsConstants.IMG_TYPE_COMMON);
            if (imgs.Count > 0)
            {
                bigsb.Append("<div class=\"bigImg\">\n");
                bigsb.Append("<ul>\n");

                if (imgs.Count > 1)
                {
                    smallsb.Append("<div class=\"sImg\">\n");
                    if (imgs.Count > 3)
                    {
                        smallsb.Append("<a href=\"javascript:;\" class=\"btnLeft\"></a>\n");
                        smallsb.Append("<a href=\"javascript:;\" class=\"btnRight\"></a>\n");
                    }
                    smallsb.Append("<div class=\"sInfo\">\n");
                    smallsb.Append("<ul>\n");
                }
                for (int i = 0; i < imgs.Count; i++)
                {
                    CmsArticleImgModel cim = (CmsArticleImgModel)imgs[i];
                    bigsb.Append("<li><img src=\"" + ConConstants.UPLOADFILES_IMAGE_PATH + cim.ImgFileName + "\" width=\"262\"/></li>\n");
                    if (imgs.Count > 1)
                    {
                        smallsb.Append("<li val=\"" + i + "\" class=\"current\"><a href=\"javascript:;\"><img src=\"" + ConConstants.UPLOADFILES_IMAGE_PATH + cim.ImgSmallFileName + "\" width=\"60\" height=\"54\"/></a></li>\n");
                    }
                }
                bigsb.Append("</ul>\n");
                bigsb.Append("</div>\n");
                if (imgs.Count > 1)
                {
                    smallsb.Append("</ul>\n");
                    smallsb.Append("</div>\n");
                }
            }
            return bigsb.Append(smallsb).ToString();
        }
        /// <summary>
        /// 美味人生 - 普通图 - 列表显示多图 - 获取列表图循环
        /// </summary>
        /// <param name="aid"></param>
        /// <returns></returns>
        public string GetHealthArticleListImgs(int aid)
        {
            StringBuilder bigsb = new StringBuilder();
            StringBuilder smallsb = new StringBuilder();
            IList imgs = CmsArticleFrontFactory.create().GetImgs(aid, CmsConstants.IMG_TYPE_COMMON);
            if (imgs.Count > 0)
            {
                bigsb.Append("<div class=\"bigImg\">\n");
                bigsb.Append("<ul>\n");

                if (imgs.Count > 1)
                {
                    smallsb.Append("<div class=\"sImg\">\n");
                    if (imgs.Count > 3)
                    {
                        smallsb.Append("<a href=\"javascript:;\" class=\"btnLeft\"></a>\n");
                        smallsb.Append("<a href=\"javascript:;\" class=\"btnRight\"></a>\n");
                    }
                    smallsb.Append("<div class=\"sInfo\">\n");
                    smallsb.Append("<ul>\n");
                }
                for (int i = 0; i < imgs.Count; i++)
                {
                    CmsArticleImgModel cim = (CmsArticleImgModel)imgs[i];
                    CmsArticleModel cam = CmsArticleFrontFactory.create().getCmsArticle(cim.ArticleId);
                    bigsb.Append("<li><img src=\"" + ConConstants.UPLOADFILES_IMAGE_PATH + cim.Img_list_file_name + "\" width=\"320\" height=\"172\" alt=\"" + cam.Title + "\"/></li>\n");
                    if (imgs.Count > 1)
                    {
                        smallsb.Append("<li val=\"" + i + "\"" + (i == 0 ? " class=\"current\"" : "") + "><a href=\"javascript:;\"><img src=\"" + ConConstants.UPLOADFILES_IMAGE_PATH + cim.ImgSmallFileName + "\" width=\"60\" height=\"54\" alt=\"" + cam.Title + "\"/></a></li>\n");
                    }
                }
                bigsb.Append("</ul>\n");
                bigsb.Append("</div>\n");
                if (imgs.Count > 1)
                {
                    smallsb.Append("</ul>\n");
                    smallsb.Append("</div>\n");
                    smallsb.Append("</div>\n");
                }
            }
            return bigsb.Append(smallsb).ToString();
        }
        /// <summary>
        /// 美味人生内容页内容图
        /// </summary>
        /// <param name="aid"></param>
        /// <returns></returns>
        public string GetHealthArticleImgs(int aid)
        {
            StringBuilder bigsb = new StringBuilder();
            StringBuilder smallsb = new StringBuilder();
            IList imgs = CmsArticleFrontFactory.create().GetImgs(aid, CmsConstants.IMG_TYPE_COMMON);
            if (imgs.Count > 0)
            {
                bigsb.Append("<div class=\"Z_YSBConLeft\">\n");
                bigsb.Append("<div class=\"Z_YSBConbigImg\">\n");
                bigsb.Append("<ul>\n");

                if (imgs.Count > 1)
                {

                    smallsb.Append("<div class=\"Z_YSBConsImg\">\n");
                    if (imgs.Count > 3)
                    {
                        smallsb.Append("<a href=\"javascript:;\" class=\"btnLeft\"></a>\n");
                        smallsb.Append("<a href=\"javascript:;\" class=\"btnRight\"></a>\n");
                    }
                    smallsb.Append("<div class=\"Z_YSBConsInfo\">\n");
                    smallsb.Append("<ul>\n");
                }
                for (int i = 0; i < imgs.Count; i++)
                {
                    CmsArticleImgModel cim = (CmsArticleImgModel)imgs[i];
                    CmsArticleModel cam = CmsArticleFrontFactory.create().getCmsArticle(cim.ArticleId);
                    bigsb.Append("<li><img src=\"" + ConConstants.UPLOADFILES_IMAGE_PATH + cim.ImgFileName + "\" width=\"262\" alt=\"" + cam.Title + "\"/></li>\n");
                    if (imgs.Count > 1)
                    {
                        smallsb.Append("<li val=\"" + i + "\" " + (i == 0 ? " class=\"Z_YSBConcurrent\"" : "") + "><a href=\"javascript:;\"><img src=\"" + ConConstants.UPLOADFILES_IMAGE_PATH + cim.ImgSmallFileName + "\" width=\"60\" height=\"54\" alt=\"" + cam.Title + "\"/></a></li>\n");
                    }
                }
                bigsb.Append("</ul>\n");
                bigsb.Append("</div>\n");

                if (imgs.Count > 1)
                {
                    smallsb.Append("</ul>\n");
                    smallsb.Append("</div>\n");
                    smallsb.Append("</div>\n");
                }
                bigsb.Append(smallsb);
                bigsb.Append("</div>\n");
            }
            return bigsb.ToString();

        }

        /// <summary>
        /// 营养生活 栏目热点
        /// </summary>
        /// <param name="cid"></param>
        /// <param name="num"></param>
        /// <returns></returns>
        public string GetNutritionColumnTop(int cid, int num)
        {
            ColumnModel cminfo = menupage.GetColumn(cid);
            StringBuilder sb = new StringBuilder();
            IList alist = CmsArticleFrontFactory.create().GetColumnTopArticleList(cid, num);
            if (alist.Count > 0)
            {
                sb.Append("<div class=\"h_boxList\">\n");
                string nimg = "/cn/images_column/Title_" + cid + ".png";
                if (cminfo.Nameimg != null && cminfo.Nameimg != "")
                {
                    nimg = ConConstants.UPLOADFILES_IMAGE_PATH + cminfo.Nameimg;
                }
                sb.Append("<div class=\"pic\"><img src=\"" + ConConstants.UPLOADFILES_IMAGE_PATH + cminfo.Ttile_img + "\" class=\"img\" /><span class=\"picBtn\"><img src=\"" + nimg + "\" /></span></div>\n");
                sb.Append("<div class=\"h_list\">\n");
                sb.Append("<ul>\n");
                for (int i = 0; i < alist.Count; i++)
                {
                    CmsArticleModel cm = (CmsArticleModel)alist[i];
                    sb.Append("<li><a href=\"" + menupage.GetArticleUrl(cm) + "\" target=\"" + ConConstants.CONTENT_TARGET + "\">" + cm.Title + "</a></li>\n");
                }
                sb.Append("</ul>\n");
                sb.Append("<p><a href=\"" + menupage.GetUrl(cminfo) + "\" class=\"hMore\">查看更多</a></p>\n");
                sb.Append("</div>\n");
                sb.Append("</div>\n");
            }
            return sb.ToString();
        }


        /// <summary>
        /// 美味人生 - 内容页 - 中粮奉献
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public string GetBrandProducts(CmsArticleModel model)
        {
            StringBuilder sb = new StringBuilder();
            
            return sb.ToString();
        }
        /// <summary>
        /// 栏目首页热门标签
        /// </summary>
        /// <param name="cid"></param>
        /// <param name="num"></param>
        /// <returns></returns>
        public string GetColumnHotsTags(int cid, int num)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("<div class=\"h_boxList\">\n");
            sb.Append("<div class=\"ZLTitle\">热门标签</div>\n");
            sb.Append("<div class=\"h_boxInfo\">\n");
            sb.Append("<div class=\"h_keybox\">\n");
            CmsArticleTagModel q = new CmsArticleTagModel();
            q.State = 1;
            q.IsHots = 1;
            q.ClassIds = cid.ToString();

            IList datalist = CmsArticleTagFactory.create().GetTagList(q);
            for (int i = 0; i < datalist.Count && i < 20; i++)
            {
                CmsArticleTagModel catm = (CmsArticleTagModel)datalist[i];
                sb.Append("<a href=\"" + GetTagUrl(catm) + "\" class=\"z_f" + catm.HotsType + "\">" + catm.TagName + "</a>");
            }
            sb.Append("</div>\n");
            sb.Append("<div class=\"h_keysearch\">\n<form action=\"/cn/search/index.aspx\" id=\"tagsearchform\" target=\"" + ConConstants.CONTENT_TARGET + "\">");
            sb.Append("<input name=\"q\" type=\"text\" class=\"text\" />\n");
            sb.Append("<input name=\"\" type=\"button\" class=\"btn\" value=\"搜索\" onclick=\"doSearch('tagsearchform',1);\"/></form>\n");
            sb.Append("</div>\n");
            sb.Append("</div>\n");
            sb.Append("</div>\n");
            return sb.ToString();
        }
        /// <summary>
        /// 标签URL
        /// </summary>
        /// <param name="tagid"></param>
        /// <returns></returns>
        public string GetTagUrl(int tagid)
        {

            CmsArticleTagModel tag = CmsArticleTagFactory.create().GetTagModel(tagid);
            return GetTagUrl(tag);
        }
        public string GetTagUrl(CmsArticleTagModel tag)
        {

            //CmsArticleTagModel tag = CmsArticleTagFactory.create().GetTagModel(tagid);
            if (tag != null)
            {
                return "javascript:doTagSearch('" + tag.TagName + "','" + tag.TagId + "');";
            }
            return "javascript:;";
        }
        /// <summary>
        /// 添加收藏URL
        /// </summary>
        /// <param name="aid"></param>
        /// <returns></returns>
        public string GetCollUrl(int aid)
        {
            return "javascript:addColl('" + aid + "');";
        }
        /// <summary>
        /// 美味人生 - 列表标签搜索
        /// </summary>
        /// <param name="cid"></param>
        /// <returns></returns>
        public string GetHealthTagSearch(int cid)
        {
            return GetAboutTagSearch(cid);
        }
        public string GetAboutTagSearch(int cid)
        {
            return "<form action=\"/cn/search/index.aspx\" id=\"csearchform\" target=\"" + ConConstants.CONTENT_TARGET + "\"><input type=\"hidden\" name=\"cid\" value=\"" + cid + "\"/><input type=\"text\" name=\"q\" value=\"请输入标签\" onfocus=\"this.value='';\"/> <a href=\"#\" onclick=\"return doSearch('csearchform',1);\"><img src=\"/cn/images/z082504.gif\" alt=\"搜索\" border=\"0\"/></a></form>"; ;
        }

        public string GetHealthArticletop(int cid)
        {

            return "<div id=\"_hitslist" + cid + "\"></div><script type=\"text/javascript\">\n_ajax('/cn/ajaxcontent.aspx','t=41&cid='+" + cid + ",function(res){$('#_hitslist" + cid + "').html(res);\n});\n</script>";
        }

        
        public string GetHealthHomeArticleHitsLeft(int cid)
        {

            return "<script type=\"text/javascript\" src=\"/cn/ajaxcontent.aspx?j=2&t=42&cid=" + cid + "\"></script>";
        }
        /// <summary>
        /// 享食之道 左人气文章
        /// </summary>
        /// <param name="cid"></param>
        /// <returns></returns>
        public string AjaxGetHealthHomeArticleHitsLeft(int cid)
        {
            StringBuilder sb = new StringBuilder();
            IList pt = CmsArticleFrontFactory.create().GetHealthArticleTop(cid, 14);//获取人气文章列表（右边）
            sb.Append("<ul class=\"txtList\">");
            for (int j = 0; j < pt.Count; j++)
            {
                CmsArticleModel cam = (CmsArticleModel)pt[j];
                sb.Append("<li><a href=\"" + menupage.GetArticleUrl(cam) + "\" target=\"" + ConConstants.CONTENT_TARGET + "\">" + cam.Title + "</a></li>");
            }
            sb.Append("</ul><a href=\"" + menupage.GetUrl(cid) + "\" class=\"hMore\">查看更多</a>");
            return sb.ToString();
        }
        public string GetHealthHotArticle(int cid)
        {
            return "<script type=\"text/javascript\" src=\"/cn/ajaxcontent.aspx?j=2&t=43&cid=" + cid + "\"></script>";
        }
        public string AjaxGetHealthHotArticle(string layerid)
        {
            StringBuilder sb = new StringBuilder();
            IList pt = CmsArticleFrontFactory.create().GetHealthArticleTop(layerid, 15);
            sb.Append("<ul>");
            for (int j = 0; j < pt.Count; j++)
            {
                CmsArticleModel cam = (CmsArticleModel)pt[j];
                sb.Append("<li><a href=\"" + menupage.GetArticleUrl(cam) + "\" target=\"" + ConConstants.CONTENT_TARGET + "\" title=\"" + cam.Title + "\">" + ContentHtmlPage.GetSubString(cam.Title, 11) + "</a></li>");
            }
            sb.Append("<li class=\"more\"><a href=\"" + menupage.GetUrl(ConConstants.HOT_ID) + "\">查看更多</a></li>");
            sb.Append("</ul>");

            return sb.ToString();
        }

        public string AjaxGetStockHtml(bool isbot)
        {
            StringBuilder sb = new StringBuilder();
            //IList alist = CmsArticleFrontFactory.create().GetArticleOrderList(ConConstants.ABOUT_STOCK_ID, 0);
            //string sid = null;
            //for (int i = 0; i < alist.Count; i++)
            //{
            //    sid = null;
            //    CmsArticleModel cm = (CmsArticleModel)alist[i];
            //    cm.Mores = CmsArticleFrontFactory.create().GetArticleMore(cm.Articleid);
            //    if (cm.Mores != null && cm.Mores.GetMoresInfo("stockid") != "")
            //    {
            //        sid = cm.Mores.GetMoresInfo("stockid");
            //        try
            //        {
            //            StockInfoModel sim = StockInfoFactory.create().GetModel(int.Parse(sid));

            //            sb.Append("<dl" + (i == (alist.Count - 1) ? " style=\"border-bottom:none\"" : "") + ">\n");
            //            sb.Append("<dt><a href=\"" + menupage.GetArticleUrl(cm) + "\" target=\"" + ConConstants.CONTENT_TARGET + "\">" + cm.Title + "</a></dt>\n");
            //            sb.Append("<dd class=\"tffa523\">" + sim.Price + "</dd>\n");
            //            sb.Append("<dd >" + sim.Per + "%</dd>");
            //            sb.Append("</dl>\n");
            //        }
            //        catch { }
            //    }




            //}
            return sb.ToString();
        }

        public string AjaxGetStockCoHtml()
        {
            StringBuilder sb = new StringBuilder();
            
            return sb.ToString();
        }

        public string AjaxGetMap(int aid)
        {
            StringBuilder sb = new StringBuilder();
            
            return sb.ToString();
        }
        private string GetColumnLayeridUrl(string[] lid, string name)
        {
            string s = "";
            for (int i = 0; i < lid.Length - 1; i++)
            {
                if (lid[i] != null && lid[i] != "")
                {
                    ColumnModel cm = menupage.GetColumn(int.Parse(lid[i]));
                    if (name != cm.Classname)
                    {
                        s += "<a href=\"" + menupage.GetUrl(cm) + "\">" + cm.Classname + "</a> > ";
                    }
                }
            }
            return s;
        }
        public string AjaxGetBrandBusCompOther(int aid)
        {
            CmsArticleMore more = CmsArticleFrontFactory.create().GetArticleMore(aid);
            StringBuilder sb = new StringBuilder();
            //sb.Append("<div class=\"h_box\">\n");
            
            return sb.ToString();
        }
    }
}
